package com.asw.springboot;

import com.asw.springboot.common.AswCustomProperties;
import com.asw.springboot.common.DataBaseProperties;
import com.asw.springboot.common.RedisProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * Created by hxq on 2017/5/11.
 */
@SpringBootApplication
@MapperScan("com.asw.springboot.dao")
@EnableScheduling
public class Application implements CommandLineRunner{

    @Autowired
    private DataBaseProperties dataBaseProperties;
    @Autowired
    private RedisProperties redisProperties;
    @Autowired
    private AswCustomProperties aswCustomProperties;

    public static void main(String[] args){
        SpringApplication.run(Application.class,args);
    }

    /***
     * 实现 CommandLineRunner接口，自定义的类才会启动
     * @param strings
     * @throws Exception
     */
    @Override
    public void run(String... strings) throws Exception {
        System.out.println("自定义加载配置文件"+aswCustomProperties.toString());
    }
}
